<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
defined('_JEXEC') or die('Restricted access');
?>
<?php JHTML::_('behavior.tooltip'); ?>
<?php

    $edit = JRequest::getVar('edit', true);
    $editor = &JFactory::getEditor();
    $text = !$edit ? JText::_('New') : JText::_('Edit');
    JToolBarHelper::title(JText::_('Article Flow History') . ': <small><small>[ ' . $text . ' ]</small></small>');
    if (!$edit) {
        JToolBarHelper::cancel();
    } else {
        // for existing items the button is renamed `close`
        JToolBarHelper::cancel('cancel', 'Close');
    }
?>
<script language="javascript" type="text/javascript">

		var sectioncategories = new Array;
		<?php
		$i = 0;
		foreach ($this->sectioncategories as $k=>$items) {
			foreach ($items as $v) {
				echo "sectioncategories[".$i++."] = new Array( '$k','".addslashes( $v->id )."','".addslashes( $v->title )."' );\n\t\t";
			}
		}
		?>
    function submitbutton(pressbutton) {
        var form = document.adminForm;
        if (pressbutton == 'cancel') {
            submitform( pressbutton );
            return;
        }

        // do field validation
        if (form.title.value == ""){
            alert( "<?php echo JText::_('Title item must have a title', true); ?>" );
        }  else {
            submitform( pressbutton );
        }
    }
</script>
<form action="index.php" method="post" name="adminForm">

    <table cellspacing="0" cellpadding="0" border="0" width="100%">
        <tr>
            <td valign="top">
                <table  class="adminform">
                    <tr>
                        <td>

                            <?php echo JText::_('Title'); ?>:

                        </td>
                        <td>
                            <input class="text_area" type="text" name="title" id="title" size="40" maxlength="255" value="<?php echo $this->items->title; ?>" />
                        </td>
                        <td>
                            <label>
                                <?php //echo JText::_('Published'); ?>
                            </label>
                        </td>
                        <td>
                            <?php //echo $this->lists['state']; ?>
                            </td>
                        </tr>
                        <tr>
                            <td>

                            <?php echo JText::_('Alias'); ?>:

                            </td>
                            <td>
                                <input class="text_area" type="text" name="alias" id="alias" size="40" maxlength="255" value="<?php echo $this->items->alias; ?>" title="<?php echo JText::_('ALIASTIP'); ?>" />
                            </td>
                            <td>
                                <label for="assigned_user">
                                    <?php echo JText::_('Chuyển đến'); ?>:
                                </label>
                            </td>
                            <td>



                                <?php
                                 $this->items->assigned_user=23;
                                echo ArticleflowHelper::buildUser($this->items->assigned_user); ?>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <?php echo JText::_('Section'); ?>:
                            </td>
                            <td>

                                <?php
                                echo $this->lists['sectionid2'];
                                //echo $this->lists['sectionid']; ?>
                            </td>
                            <td>
                            <?php echo JText::_('Category'); ?>:
                            </td>
                            <td>
                            <?php
                             echo $this->lists['catid'];
                               // echo ArticleflowHelper::buildCategory( $this->items->sectionid);
                               ?>
                            </td>
                        </tr>
                    </table>

                </td>

            </tr>
            <tr>
                <td valign="center">
                    Giới thiệu:

                            <?php
                                // parameters : areaname, content, width, height, cols, rows
                                echo $editor->display('introtext', $this->items->introtext, '80%', '350', '75', '20');
                            ?>

                </td>
            </tr>
            <tr>
                <td valign="center">
                    Nội dụng:

                            <?php
                                // parameters : areaname, content, width, height, cols, rows
                                echo $editor->display('fulltext', $this->items->fulltext, '80%', '550', '75', '20');
                            ?>

                </td>
            </tr>
        </table>
        <input type="hidden" name="option" value="com_articleflow" />
        <input type="hidden" name="cid[]" value="<?php echo $this->items->content_temp_id; ?>" />
        <input type="hidden" name="view" value="history" />
        <input type="hidden" name="task" value="" />
    <?php echo JHTML::_('form.token'); ?>
</form>